import axios from '@/api/fetch';
import SERVER from '@/api/server';

/** */
// 查询盘点单号
export const inventoryCheck = params => axios.get(`${SERVER.DMSCLOUD_PART}/basedata/inventoryCheck`, { params });
// 查仓库
export const findStorageCode = params => axios.get(`${SERVER.DMSCLOUD_PART}/basedata/partStocks/findUserControlStorageCode`, { params });
// 点确认 part/basedata/inventoryCheck/addNewInventoryNo
export const addNewInventoryNo = params => axios.post(`${SERVER.DMSCLOUD_PART}/basedata/inventoryCheck/addNewInventoryNo`, params);
// 新盘点单号
export const saveBlankInventoryNo = params => axios.post(`${SERVER.DMSCLOUD_PART}/basedata/inventoryCheck/saveBlankInventoryNo`, params);
// 车型组集
export const querypartGroupCodes = params => axios.get(`${SERVER.DMSCLOUD_PART}/basedata/partStocks/querypartGroupCodes`, { params });
// 查询盘点单 /basedata/inventoryCheck/findItemById/{[盘点单号]}/0
export const findAllInventoryItemById = id => axios.get(`${SERVER.DMSCLOUD_PART}/basedata/inventoryCheck/findItemById/${id}/0`);
// 主页面 保存 POST:/basedata/inventoryCheck/saveInventoryInfo
export const saveInventoryCheck = params => axios.post(`${SERVER.DMSCLOUD_PART}/basedata/inventoryCheck/saveInventoryInfo`, params);
// 盘点确认 /basedata/inventoryCheck/btnConfirm
export const confirmInventoryCheck = params => axios.post(`${SERVER.DMSCLOUD_PART}/basedata/inventoryCheck/btnConfirm`, params);
// 作废 /basedata/inventoryCheck/btnDel
export const cancelInventoryCheck = params => axios.post(`${SERVER.DMSCLOUD_PART}/basedata/inventoryCheck/btnDel`, params);
// 新增查询盘点备件
export const getNewPartData = params => axios.get(`${SERVER.DMSCLOUD_PART}/stockmanage/allocateInOders/findPartForAdd`, { params });

/** */

export const partStocktakingByDto = params => axios.get(`${SERVER.DMSCLOUD_PART}/stock/partStocktakingByDto`, { params });

export const findAllInventoryInfo = params => axios.get(`${SERVER.DMSCLOUD_PART}/inventory`, { params });

export const findAllInventoryItemInfoById = params => axios.get(`${SERVER.DMSCLOUD_PART}/inventory/findItemById`, { params });

export const saveInventoryInfo = params => axios.post(`${SERVER.DMSCLOUD_PART}/inventory/saveInventoryInfo`, params);

export const btnDel = params => axios.post(`${SERVER.DMSCLOUD_PART}/inventory/btnDel`, params);

export const btnConfirm = params => axios.post(`${SERVER.DMSCLOUD_PART}/inventory/btnConfirm`, params);

export const findPartInfo = params => axios.get(`${SERVER.DMSCLOUD_PART}/inventory/findPartInfo`, { params });

// export const addNewInventoryNo = params => axios.post(`${SERVER.DMSCLOUD_PART}/inventory/addNewInventoryNo`,  params  );

export const deleteTableData = params => axios.post(`${SERVER.DMSCLOUD_PART}/inventory/deleteTableData`, params);

export const tableEdit = params => axios.post(`${SERVER.DMSCLOUD_PART}/inventory/tableEdit`, params);
// 获取单一系统参数
export const getSysParaValueByCode = params => axios.get(`${SERVER.DMSCLOUD_BASEDATA}/params/getSysParaValueByCode`, { params });

// 新建时生成空盘点单
// export const saveBlankInventoryNo = params => axios.post(`${SERVER.DMSCLOUD_PART}/inventory/saveBlankInventoryNo`, params);

// 删除整个盘点单
export const deleteWholeOrder = params => axios.post(`${SERVER.DMSCLOUD_PART}/inventory/deleteTableData`, params);
// 查询盘点单号
export const checkPart = params => axios.get(`${SERVER.DMSCLOUD_PART}/basedata/inventoryCheck/checkPart`, { params });

export const printReport = params => axios.post(`${SERVER.DMSCLOUD_PART}/basedata/inventoryCheck/printReport`, params);
